package org.kojo.tdrm.valbean;

import org.apache.tools.ant.util.DateUtils;
import org.kojo.tdrm.entity.Task;

public class TaskVal {
	private String id;
	private String name;
	private String dueDate;
	private String note;
	private String priority;
	private String state;
	private String lastUpdate;
	private String ownedUser;
	private int repeatType = 0;
	private int repeatEvery =0;
	
	public TaskVal(){
		
	}
	
	public TaskVal(Task t) {
		this.id = Long.toString(t.getKey().getId());
		this.name = t.getName();
		this.dueDate = DateUtils.format(t.getDueDate(), "dd/MM/yyyy");
		this.note = t.getNote();
		this.priority = Integer.toString(t.getPriority());
		this.state = Integer.toString(t.getState());
		this.lastUpdate = DateUtils.format(t.getLastUpdate(), "dd/MM/yyyy HH:mm:ss");
		this.ownedUser = t.getOwnedUserId();
		this.repeatType = t.getRepeatType();
		this.repeatEvery = t.getRepeatEvery();
	}
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDueDate() {
		return dueDate;
	}
	public void setDueDate(String dueDate) {
		this.dueDate = dueDate;
	}
	public String getNote() {
		return note;
	}
	public void setNote(String note) {
		this.note = note;
	}
	public String getPriority() {
		return priority;
	}
	public void setPriority(String priority) {
		this.priority = priority;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public String getLastUpdate() {
		return lastUpdate;
	}
	public void setLastUpdate(String lastUpdate) {
		this.lastUpdate = lastUpdate;
	}
	public String getOwnedUser() {
		return ownedUser;
	}
	public void setOwnedUser(String ownedUser) {
		this.ownedUser = ownedUser;
	}

	public int getRepeatType() {
		return repeatType;
	}

	public void setRepeatType(int repeatType) {
		this.repeatType = repeatType;
	}

	public int getRepeatEvery() {
		return repeatEvery;
	}

	public void setRepeatEvery(int repeatEvery) {
		this.repeatEvery = repeatEvery;
	}
	
	
}
